var table_field = null;
var table_view = null; 
table_field = [
    {
        tablename: "log_8053",//公用的信息
        fields: {
            id: { des: "id", type: "INT(11) PRIMARY KEY" },
            deviceid:{des:"设备id",type:"varchar(20)"},
            fid: { des: "描述", type: "varchar(20)" },
            projectid:{des:"项目id",type:"varchar(20)"},
            devicestatus: { des: "设备状态", type: "tinyint(2)" },
            deviceerror: { des: "设备故障", type: "tinyint(2)" },
            gcjs1: { des: "过程警示1", type: "tinyint(2)" },
            gcjs2: { des: "过程警示1", type: "tinyint(2)" },
            cell: { des: "电池电量", type: "tinyint(2)" },
            memo: { des: "备用字段", type: "tinyint(2)" },
            value1: { des: "过程测量值1-浇筑深度", type: "float(4)" , chart:"line"},
            value2: { des: "过程测量值2-探测孔深", type: "float(4)" ,chart:"line"},
            value3: { des: "过程测量值3-预留", type: "float(4)" }

        }
    }
    
];
table_view = [
    {
        tablename: "view_device_project",
        type: "left",
        table: {
            left: {
                name: "device",
                fields: "*"
            },
            right: {
                name: "project",
                fields: "name proname,code procode"
            }
        },
        where: "on a.projectid = b.id",
    },
    {
        tablename: "view_role_user",
        type: "left",
        table: {
            left: {
                name: "user",
                fields: "*"
            },
            right: {
                name: "role",
                fields: "name rolename"
            }
        },
        where: "on a.roleid = b.id"
    },
    {
        tablename: "view_project_data_8053",
        type: "left",
        table: {
            left: {
                name: "log_8053",
                fields:"*"
            },
            right: {
                name: "project",
                fields: "name proname"
            }
        },
        where: "on a.projectid = b.id",
     },
     {
            tablename: "view_warnreport_project",
            type: "left",
            table: {
                left: {
                    name: "warn_report",
                    fields: "*"
                },
                right: {
                    name: "project",
                    fields: "name proname"
                }
            },
            where: "on a.projectid = b.id",
        },
    {
        tablename: "view_logwork_project",
        type: "left",
        table: {
            left: {
                name: "logwork",
                fields: "*"
            },
            right: {
                name: "project",
                fields: "name proname"
            }
        },
        where: "on a.projectid = b.id",
    },
    {
        tablename: "view_project_data_8051",
        type: "left",
        table: {
            left: {
                name: "log",
                fields: "*",
            },
             right: {
                name: "project",
                fields: "name proname"
             },
        },
        where: "on a.projectid = b.id",
    },
    {
        tablename: "view_budget_project",
        type: "left",
        table: {
            left: {
                name: "budget",
                fields: "*"
            },
            right: {
                name: "project",
                fields: "name proname"
            }
        },
        where: "on a.projectid = b.id"
    }
];
//角色和用户
//项目和设备数据
exports.table_field = table_field;
exports.table_view = table_view;
